package com.ruoyi.common.enums;

/**
 * 用户状态
 *
 * @author ruoyi
 */
public enum WarningLevel {
    // 预警等级（1低，2中，3高））
    LOW(1L, "低"),
    MEDIUM(2L, "中"),
    HIGH(3L, "高");

    private final Long code;
    private final String name;

    public static String getNameByCode(Long code){
        for (WarningLevel disposeStatus : WarningLevel.values()) {
            if (code.equals(disposeStatus.code)){
                return disposeStatus.name;
            }
        }
        return "";
    }

    WarningLevel(Long code, String info) {
        this.code = code;
        this.name = info;
    }

    public Long getCode() {
        return code;
    }

    public String getName() {
        return name;
    }
}
